package com.jams.goodox.activity.login;

import android.content.res.TypedArray;

import com.bigkoo.convenientbanner.ConvenientBanner;
import com.bigkoo.convenientbanner.holder.CBViewHolderCreator;
import com.jams.goodox.BaseActivity;
import com.jams.goodox.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;

/**
 * Created by DWCloud on 2016/6/17.
 */
public class GuideActivity extends BaseActivity {
    @Bind(R.id.guide)
    ConvenientBanner guide;


    List<Integer> img = new ArrayList<>();

    @Override
    protected int getLayoutId() {
        return R.layout.layout_guide;
    }

    @Override
    protected void init() {
        setTitleVisibility(false);
        TypedArray guideImages = getResources().obtainTypedArray(R.array.guide_images);
        for (int i = 0; i < guideImages.length(); i++) {
            img.add(guideImages.getResourceId(i, 0));
        }
        guideImages.recycle();
        guide.setCanLoop(false);
        guide.setPages(
                new CBViewHolderCreator<GuideBannerHolder>() {
                    @Override
                    public GuideBannerHolder createHolder() {
                        return new GuideBannerHolder();
                    }
                }, img);

        guide.setCanLoop(false);
        guide.setcurrentitem(0);

    }


}
